109

Create Your Own Interface Diagram

109

STEP 3 & 4—​draw arrow function

      Sheets(CurrentSheetName).Cells(i, 3).Value =​ Sheets(CurrentSheetName).

Cells(i, 1).Value & “-​” & i

    End If

    FoundPair =​ 0

    For j =​ 1 To NumberOfRows

      If Pair(j) <> ““ Then

        If Pair(j) =​ Sheets(CurrentSheetName).Cells(i, 1).Value &

Sheets(CurrentSheetName).Cells(i, 2).Value Then

          FoundPair =​ j

        Exit For

      End If

    End If

Next

‘ *** Left Shape has 1 space before its name, Right Shape has 2 ***

    If OldShapeBegin And FoundPair =​ 0 Then

      ActiveSheet.Shapes(Sheets(CurrentSheetName).Cells(i, 1).Value).Select

      If Left((Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text),

2) =​ “ ” Then

      FromConnection =​ 1

      CircleLeft =​ Selection.ShapeRange(1).Left

      CircleTop =​ Selection.ShapeRange(1).Top

    Else

      FromConnection =​ 3

      adjustment =​ 10

    End If

Else

    FromConnection =​ 4

End If

    If OldShapeEnd And FoundPair =​ 0 Then

      ActiveSheet.Shapes(Sheets(CurrentSheetName).Cells(i, 1).Value).Select

      If Left((Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text),

2) =​ “ ” Then

      ToConnection =​ 2

    Else

      ToConnection =​ 2

    End If

Else

      ToConnection =​ 2

    End If

If (OldShapeBegin Or OldShapeEnd) And FoundPair =​ 0 Then

    If FromConnection =​ 1 Then

‘add circle

    ActiveSheet.Shapes.AddShape(msoShapeOval, CircleLeft +​ 250, CircleTop, 16.5,

21).Select

    Selection.ShapeRange.Fill.Visible =​ msoFalse

    Selection.ShapeRange.Name =​ “Oval-​” & i

    ‘add connection from 1st box to circle

    ActiveSheet.Shapes.AddConnector(msoConnectorElbow, 1, 1, 1, 1).Select

    ArrowColor =​ (20 +​ 5 * 1) Mod 255